import os

provider = 'issn'
filePath = provider + '_cover.txt'
sPath = r'E:\样例数据\issn_cover\issn_latest'


with open(filePath, mode='w', encoding='utf-8') as f:
    for path, dirNames, fileNames in os.walk(sPath):
        for fileName in fileNames:
            # 分离文件名与扩展名 返回文件名和扩展名
            issn = os.path.splitext(fileName)[0]
            line = issn + '★/smartlib/' + provider + '/' + fileName + '\n'
            f.write(line)